package com.js.purs.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.js.purs.mapper.PurProdPlanFileMapper;
import com.js.purs.domain.PurProdPlanFile;
import com.js.purs.service.IPurProdPlanFileService;

/**
 * 采购计划附件Service业务层处理
 * 
 * @author lzq
 * @date 2024-06-13
 */
@Service
public class PurProdPlanFileServiceImpl implements IPurProdPlanFileService 
{
    @Autowired
    private PurProdPlanFileMapper purProdPlanFileMapper;

    /**
     * 查询采购计划附件
     * 
     * @param fileId 采购计划附件主键
     * @return 采购计划附件
     */
    @Override
    public PurProdPlanFile selectPurProdPlanFileByFileId(String fileId)
    {
        return purProdPlanFileMapper.selectPurProdPlanFileByFileId(fileId);
    }

    /**
     * 查询采购计划附件列表
     * 
     * @param purProdPlanFile 采购计划附件
     * @return 采购计划附件
     */
    @Override
    public List<PurProdPlanFile> selectPurProdPlanFileList(PurProdPlanFile purProdPlanFile)
    {
        return purProdPlanFileMapper.selectPurProdPlanFileList(purProdPlanFile);
    }

    /**
     * 新增采购计划附件
     * 
     * @param purProdPlanFile 采购计划附件
     * @return 结果
     */
    @Override
    public int insertPurProdPlanFile(PurProdPlanFile purProdPlanFile)
    {
        purProdPlanFile.setCreateTime(DateUtils.getNowDate());
        return purProdPlanFileMapper.insertPurProdPlanFile(purProdPlanFile);
    }

    /**
     * 修改采购计划附件
     * 
     * @param purProdPlanFile 采购计划附件
     * @return 结果
     */
    @Override
    public int updatePurProdPlanFile(PurProdPlanFile purProdPlanFile)
    {
        return purProdPlanFileMapper.updatePurProdPlanFile(purProdPlanFile);
    }

    /**
     * 批量删除采购计划附件
     * 
     * @param fileIds 需要删除的采购计划附件主键
     * @return 结果
     */
    @Override
    public int deletePurProdPlanFileByFileIds(String[] fileIds)
    {
        return purProdPlanFileMapper.deletePurProdPlanFileByFileIds(fileIds);
    }

    /**
     * 删除采购计划附件信息
     * 
     * @param fileId 采购计划附件主键
     * @return 结果
     */
    @Override
    public int deletePurProdPlanFileByFileId(String fileId)
    {
        return purProdPlanFileMapper.deletePurProdPlanFileByFileId(fileId);
    }

    @Override
    public int deletePurProdPlanFileByFileName(String fileName) {
        return purProdPlanFileMapper.deletePurProdPlanFileByFileName(fileName);
    }

    @Override
    public List<PurProdPlanFile> selectPurProdPlanFilePlanCode(String planCode) {
        return purProdPlanFileMapper.selectPurProdPlanFilePlanCode(planCode);
    }
}
